package track2.result;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;

import track2.context.Config;

public class ResultFileTool {
	

	public static void outputResult(Result result, String path){
		NumberFormat formatter = new DecimalFormat("#0.000000");
		try{
			BufferedWriter bw = new BufferedWriter(new FileWriter(path));
			for (int i = 0; i < result.resultScore.length; i++){
				bw.write(formatter.format(result.resultScore[i]));
				bw.write("\n");
			}
			bw.close();
			System.out.println("Output result to file");
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	


}
